package com.whiteape.book.model.dto;

import android.os.Parcel;
import android.os.Parcelable;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

@Entity
public class CollectionMediaGroupBean implements Parcelable {
    @Id
    private String id;

    private String name;

    private Boolean encrypted = false;

    public CollectionMediaGroupBean(Parcel parcel){
       this.id = parcel.readString();
       this.name = parcel.readString();
       this.encrypted = parcel.readByte() != 0;
    }
    @Generated(hash = 1121727434)
    public CollectionMediaGroupBean(String id, String name, Boolean encrypted) {
        this.id = id;
        this.name = name;
        this.encrypted = encrypted;
    }

    @Generated(hash = 1382859562)
    public CollectionMediaGroupBean() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(name);
        dest.writeByte(encrypted ? (byte)1 : (byte)0);
    }


    public static final Creator<CollectionMediaGroupBean> CREATOR = new Creator<CollectionMediaGroupBean>() {
        @Override
        public CollectionMediaGroupBean createFromParcel(Parcel source) {
            return new CollectionMediaGroupBean(source);
        }

        @Override
        public CollectionMediaGroupBean[] newArray(int size) {
            return new CollectionMediaGroupBean[size];
        }
    };

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getEncrypted() {
        return this.encrypted;
    }

    public void setEncrypted(Boolean encrypted) {
        this.encrypted = encrypted;
    }
}
